package com.cloudkinto.controller.order.outbound;


import com.cloudkinto.base.BaseController;
import com.cloudkinto.bo.order.outbound.OutboundCancelAddBo;
import com.cloudkinto.common.annotations.UserSessionRequired;
import com.cloudkinto.common.web.SingleResult;
import com.cloudkinto.service.order.outbound.OutboundCancelService;
import com.cloudkinto.vo.common.CommonBatchOperationVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 出库单截单 前端控制器
 * </p>
 *
 * @author long
 * @since 2024-12-09
 */
@RestController
@RequiredArgsConstructor
@Api(tags = "oms出库单截单")
@RequestMapping("/api/admin/oms/cancel")
public class OutboundCancelOmsController extends BaseController {
    private final OutboundCancelService cancelService;

    @UserSessionRequired
    @PostMapping("/batchAdd")
    @ApiOperation(value = "出库单截单新增", notes = "出库单截单新增")
    @ApiResponses(@ApiResponse(code = 200, message = "", response = CommonBatchOperationVo.class))
    public SingleResult add(@RequestBody @Validated OutboundCancelAddBo req) {
        return SingleResult.success("新增成功", cancelService.add(req, getCurrentUserId(), getUserName()));
    }
}

